<extend name="Base/common"/>
<block name="body">
<div id="member_info2"></div>
<script type="text/javascript">
$(function(){
    collection('a#collection');
    fcbox("#login_now", true); //登录弹窗
});
function collection(id){
    $(id).click(function(){
        var goods_id = $(this).attr('oprid');
        $.post(www_domain + "/user/collection", { is_ajax : 1, ids : goods_id, collection : 1 },
                function(result){
                    alert(result);
        }, "json");
    });
}
var refresh_gift_card_list = function(){};
function pop_login(){
    $("#login_now").trigger("click");
}
</script>
<div id="main">
    <div class="w930 m0a mt30">
  <div class="right_style">
  <div class="title_style"><em></em>订单管理</div> 
   <div class="Order_form_style">
      <div class="Order_form_list">
         <table>
         <thead>
          <tr><td class="list_name_title0">商品</td>
          <td class="list_name_title1">单价(元)</td>
          <td class="list_name_title2">数量</td>
          <td class="list_name_title6">操作</td>
         </tr>
         </thead>
         <volist name="shop" id="v">
             <tbody>       
           <tr class="Order_info">
           <td colspan="6" class="Order_form_time">
           <input tabindex="13" type="checkbox" class="fuxuan" id="flat-checkbox-1">下单时间：{$v.addtime|time_format} | 订单号：{$v.ding}</td></tr>
           <tr class="Order_Details">
           <td colspan="3">
           <table class="Order_product_style">
           <tbody>
           <tr>
           <td>
            <div class="product_name clearfix">
            <a href="#" class="product_img">
            <img src="/Uploads/{$picd[$key]}" width="80px" height="80px"></a>
            </div>
            </td>
            <td width="300px" style="margin: auto;">
            <a >{$title[$key]}</a>
            </td>
            <td class="danjia">{$prices[$key]}</td>
           <td>
           <span class="add">+</span>
           <input style="width:40px" type="text" name="num" value="{$v.num}" class="float-lt choose_input"/>
          <span class="lose">-</span>
          </td>
            </tr>
            </tbody></table>
           </td>   
           <td class="operating">
                <a href="{:U('Xiang/index',array('id'=>$v['gid']))}">查看详细</a>
                <a href="{:U('Shops/delete',array('id'=>$v['id']))}">删除</a>
          </td>
           </tr>
           </tbody> 
           </volist> 
         </table>
   <script>
            $(document).ready(function(){
              $('.Order_form_style input').iCheck({
                checkboxClass: 'icheckbox_flat-green',
                radioClass: 'iradio_flat-green'
              });
            });
            </script>
  </div>
 </div>
</div>
        <div class="w930 m0a">
            <div class="fl">
                <div class="mt50">
                    <a href="{:U('Jiesuan/index')}" class="f14 bold c999 b_1_efe btnf7f w146 h40 fl tc">继续购物</a>
                </div>
            </div>
            <div class="fr">
                <div class="tc cd00 mt20">
                    <span class="f13 bold">商品总额：￥</span>
                    <span class="f20" id="goods_amount">0</span>
                </div>
                
                <div class="mt20 tr">
                    <input type="hidden" id="all_has_stock" value="1">
                <input onclick="{:U('Jiesuan/index')}" type="submit" class="btnd00 w146 h40 f16 bold" value="去结算" />
                </div>
            </div>
        </div>
    </div>
</div>
<div id="dsp" style="display:none;">
<link rel="stylesheet" href="__CSS__/2.css">
<script type="text/javascript">
var _mvq = _mvq || [];
_mvq.push(['$setAccount', 'm-25646-0']);
_mvq.push(['$setGeneral', 'cartview', '', '', '0']);
_mvq.push(['$logConversion']);
_mvq.push(['$addItem', '', '25523', '','']);
_mvq.push(['$logData']);
</script>
</div>
<link rel="stylesheet" href="css/fancybox.css" type="text/css">
<script type="text/javascript" src="Script/fancybox.js"></script>
<div id="kfs" style="display: none; ">
  <div class="context"> <a href="javascript:void(0);" onclick="javascript:NTKF.im_openInPageChat(&#39;kf_9988_1341905703263&#39;);_gaq.push([&#39;_trackEvent&#39;,&#39;kefuxiaochuang&#39;, &#39;tousu&#39;, location.href]);" class="show" title="打开" rel="nofollow">&nbsp;</a> </div>
</div>
<script src="__JS__/jquery-1.8.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
  KFHover('.context span');
});
function KFHover(ipt){
    $(ipt).hover(function(){
        var cls     = $(this).attr('class');
        var css  = cls.substr(cls.lastIndexOf("kf_btn"), 8) ;
        $(this).removeClass(css).addClass(css + 'Hover');
    },function(){
        var cls     = $(this).attr('class');
        var css  = cls.substr(cls.lastIndexOf("kf_btn"), 8);
        $(this).removeClass(css + 'Hover').addClass(css);
    });
}
    $(function(){ 
      $('.add').click(function(){
          var index = $('.add').index($(this));
         
          var num=$('input[name=num]').eq(index).val();
            num++;
              var r = /^[0-9]*[1-9][0-9]*$/;
                if(!r.test(num)){
                    num=Math.floor(num);
                }
              $('input[name=num]').eq(index).val(num);     
        });
     $('.lose').click(function(){
         var index = $('.lose').index($(this));
         var num=$('input[name=num]').eq(index).val();
            num--;
              var r = /^[0-9]*[1-9][0-9]*$/;
                if(!r.test(num)){
                    num=Math.floor(num);
                }
                if (num<1) {
                  num=1;
                }
                $('input[name=num]').eq(index).val(num);
              });
       $('.checkbox').click(function(){
        if($(this).is(":checked")){
          var zongjia={$zongjia};
          $('.fuxuan').prop("checked",true);
          $('.f20').html(zongjia);
        }else{
           $('.fuxuan').prop("checked",false);
        }
          })
        var zongjia=0;
       $('.fuxuan').click(function(){
        var index=$('.fuxuan').index($(this));
        var price=Number($(".danjia").eq(index).html());
        var num=($(".choose_input").eq(index).val());
        //alert(index);
        if($(this).is(":checked")){
          zongjia+=price*num;
          $('.f20').html(zongjia);
        }else{
          zongjia-=price*num;
           $('.f20').html(zongjia);
        }
       })
       $('.add').click(function(){
        var index=$('.add').index($(this));
        var price=Number($(".danjia").eq(index).html());
        var num=($(".choose_input").eq(index).val());
        //alert(index);
        if($('.fuxuan').is(":checked")){
          zongjia+=price;
          $('.f20').html(zongjia);
        }
       });
       $('.lose').click(function(){
        var index=$('.lose').index($(this));
        var price=Number($(".danjia").eq(index).html());
        var num=($(".choose_input").eq(index).val());
        //alert(index);
        if(num>1){
        if($('.fuxuan').is(":checked")){
          zongjia-=price;
          $('.f20').html(zongjia);
        }
      }else{
         $('.f20').html(price);
      }
       });
       });
</script>
  </div>
     </div>
   </div>
</block>
